<?php
/**
 * SocialEnginePro
 *
 * @category   Application_Extensions
 * @package    tv
 * @author     Azim
 */

/**
 * @category   Application_Extensions
 * @package    tv
 */
class Tv_Form_Admin_Level extends Authorization_Form_Admin_Level_Abstract
{
  public function init()
  {
    parent::init();

    // My stuff
    $this
      ->setTitle('Member Level Settings')
      ->setDescription('These settings are applied on a per member level basis. Start by selecting the member level you want to modify, then adjust the settings for that level below.');

    // Element: view
    $this->addElement('Radio', 'view', array(
      'label' => 'Allow Viewing of tv?',
      'description' => 'Do you want to let members view tv? If set to no, some other settings on this page may not apply.',
      'multiOptions' => array(
        2 => 'Yes, allow viewing of all tv, even private ones.',
        1 => 'Yes, allow viewing of tv.',
        0 => 'No, do not allow tv to be viewed.',
      ),
      'value' => ( $this->isModerator() ? 2 : 1 ),
    ));
    if( !$this->isModerator() ) {
      unset($this->view->options[2]);
    }

    if( !$this->isPublic() ) {

      // Element: create
      $this->addElement('Radio', 'create', array(
        'label' => 'Allow Creation of tv?',
        'description' => 'Do you want to let members create tv? If set to no, some other settings on this page may not apply. This is useful if you want members to be able to view tv, but only want certain levels to be able to create tv.',
        'multiOptions' => array(
          1 => 'Yes, allow creation of tv.',
          0 => 'No, do not allow tv to be created.'
        ),
        'value' => 1,
      ));

      // Element: edit
      $this->addElement('Radio', 'edit', array(
        'label' => 'Allow Editing of tv?',
        'description' => 'Do you want to let members edit tv? If set to no, some other settings on this page may not apply.',
        'multiOptions' => array(
          2 => 'Yes, allow members to edit all tv.',
          1 => 'Yes, allow members to edit their own tv.',
          0 => 'No, do not allow members to edit their tv.',
        ),
        'value' => ( $this->isModerator() ? 2 : 1 ),
      ));
      if( !$this->isModerator() ) {
        unset($this->edit->options[2]);
      }
      
      // Element: invate
      $this->addElement('Radio', 'invite', array(
        'label' => 'Allow Invite of TV?',
        'description' => 'Do you want to let members invate TV? If set to no, some other settings on this page may not apply.',
        'multiOptions' => array(
          2 => 'Yes, allow members to invate all Tv.',
          1 => 'Yes, allow members to invate their own TV.',
          0 => 'No, do not allow members to invate their TV.',
        ),
        'value' => ( $this->isModerator() ? 2 : 1 ),
      ));
      if( !$this->isModerator() ) {
        unset($this->invate->options[2]);
      }
      
      
       // Element: featurted
      $this->addElement('Radio', 'favourite', array(
        'label' => 'Allow Favourite of TV?',
        'description' => 'Do you want to let members favourite TV? If set to no, some other settings on this page may not apply.',
        'multiOptions' => array(
          2 => 'Yes, allow members to favourite all Tv.',
          1 => 'Yes, allow members to favourite their own TV.',
          0 => 'No, do not allow members to favourite their TV.',
        ),
        'value' => ( $this->isModerator() ? 2 : 1 ),
      ));
      if( !$this->isModerator() ) {
        unset($this->favourite->options[2]);
      }
      
      // Element: delete
      $this->addElement('Radio', 'delete', array(
        'label' => 'Allow Deletion of TV?',
        'description' => 'Do you want to let members delete tv? If set to no, some other settings on this page may not apply.',
        'multiOptions' => array(
          2 => 'Yes, allow members to delete all tv.',
          1 => 'Yes, allow members to delete their own tv.',
          0 => 'No, do not allow members to delete their tv.',
        ),
        'value' => ( $this->isModerator() ? 2 : 1 ),
      ));
      if( !$this->isModerator() ) {
        unset($this->delete->options[2]);
      }

      // Element: comment
      $this->addElement('Radio', 'comment', array(
            'label' => 'Allow Commenting on tv?',
        'description' => 'Do you want to let members of this level comment on tv?',
        'multiOptions' => array(
          2 => 'Yes, allow members to comment on all tv, including private ones.',
          1 => 'Yes, allow members to comment on tv.',
          0 => 'No, do not allow members to comment on tv.',
        ),
        'value' => ( $this->isModerator() ? 2 : 1 ),
      ));
      if( !$this->isModerator() ) {
        unset($this->comment->options[2]);
      }

      

      // Element: auth_view
      $this->addElement('MultiCheckbox', 'auth_view', array(
        'label' => 'TV Privacy',
        'description' => 'Your members can choose from any of the options checked below when they decide who can see their tv. If you do not check any options, everyone will be allowed to view tv.',
        'multiOptions' => array(
          'everyone'            => 'Everyone',
          'registered'          => 'All Registered Members',
          'owner_network'       => 'Friends and Networks',
          'owner_member_member' => 'Friends of Friends',
          'owner_member'        => 'Friends Only',
          'owner'               => 'Just Me',
        ),
        'value' => array('everyone', 'owner_network', 'owner_member_member', 'owner_member', 'owner'),
      ));

      // Element: auth_comment
      $this->addElement('MultiCheckbox', 'auth_comment', array(
        'label' => 'TV Comment Options',
        'description' => 'Your members can choose from any of the options checked below when they decide who can post comments on their tv. If you do not check any options, everyone will be allowed to post comments on media.',
        'multiOptions' => array(
          'everyone'            => 'Everyone',
          'registered'          => 'All Registered Members',
          'owner_network'       => 'Friends and Networks',
          'owner_member_member' => 'Friends of Friends',
          'owner_member'        => 'Friends Only',
          'owner'               => 'Just Me',
        ),
        'value' => array('everyone', 'owner_network', 'owner_member_member', 'owner_member', 'owner'),
      ));

      

    }
    
  }
}